<?php
	date_default_timezone_set('America/New_York');
	require_once('/globals.php');
	// TODO: enforce login policy and redirect if user is logged in
	// if(adminIsLoggedIn()):
		// redirectAdminToAdminPage();
	// else:
	if($_SERVER['REQUEST_METHOD'] == 'POST'):
		$username = sanitizeString($_POST['username']);
		$password = sanitizeStringKeepSpaces($_POST['password']);			
		
		login($username, $password);
		exit;
	elseif ($_SERVER['REQUEST_METHOD'] == 'GET'):
		require_once("login_form.html");
		exit;
	endif;
	// endif;	
?>